package com.cpi.rowmapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.cpi.model.CpiData;

public class CpiDataRowmapper implements IRowMapper<CpiData> {

	@Override
	public CpiData RowMapper(ResultSet rs) throws SQLException {
		CpiData cpiData=new CpiData();
		cpiData.setAreaid(rs.getInt("id"));
		cpiData.setCpidata(rs.getDouble("cpidata"));
		cpiData.setDatabit(rs.getString("databit"));
		cpiData.setOntime(rs.getDate("ontime"));
		cpiData.setInyear(rs.getInt("inyear"));
		cpiData.setInmonth(rs.getInt("inmonth"));
		cpiData.setIndays(rs.getInt("indays"));
		cpiData.setDatatypeid(rs.getInt("areaid"));
		cpiData.setAreaid(rs.getInt("areaid"));
		cpiData.setDemo(rs.getString("demo"));
		cpiData.setKstr1(rs.getString("kstr1"));
		cpiData.setKstr2(rs.getString("kstr2"));
		cpiData.setKstr3(rs.getString("kstr3"));
		cpiData.setKint1(rs.getInt("kint1"));
		cpiData.setKint2(rs.getInt("kint2"));
		cpiData.setKint3(rs.getInt("kint3"));
		return  cpiData;
		
	}

	
}
